<template>
  <div class="app-container">
    <el-descriptions title="学生信息" border>
      <el-descriptions-item label="学号">{{ data.id }}</el-descriptions-item>
      <el-descriptions-item label="姓名">{{ data.name }}</el-descriptions-item>
      <el-descriptions-item label="性别">{{ data.sex }}</el-descriptions-item>
      <el-descriptions-item label="民族">{{ data.nation }}</el-descriptions-item>
      <el-descriptions-item label="学院">{{ data.college }}</el-descriptions-item>
      <el-descriptions-item label="年级">{{ data.grade }}</el-descriptions-item>
      <el-descriptions-item label="专业">{{ data.major }}</el-descriptions-item>
      <el-descriptions-item label="班级">{{ data.class }}</el-descriptions-item>
      <el-descriptions-item label="身份证号">{{ data.idcard }}</el-descriptions-item>
      <el-descriptions-item label="学生来源">{{ data.source }}</el-descriptions-item>
      <el-descriptions-item label="家庭地址">{{ data.address }}</el-descriptions-item>
    </el-descriptions>
    <div class="blank" />
    <el-descriptions :column="4" title="体测信息" border>
      <el-descriptions-item label="身高">{{ data.height }}</el-descriptions-item>
      <el-descriptions-item label="体重">{{ data.weight }}</el-descriptions-item>
      <el-descriptions-item label="肺活量">{{ data.pulmonary }}</el-descriptions-item>
      <el-descriptions-item label="50米跑">{{ data.run50 }}</el-descriptions-item>
      <el-descriptions-item label="立定跳远">{{ data.jump }}</el-descriptions-item>
      <el-descriptions-item label="坐位体前屈">{{ data.flexion }}</el-descriptions-item>
      <el-descriptions-item label="800米跑">{{ data.run800 }}</el-descriptions-item>
      <el-descriptions-item label="1000米跑">{{ data.run1000 }}</el-descriptions-item>
      <el-descriptions-item label="一分钟仰卧起坐">{{ data.abdominal_curl }}</el-descriptions-item>
      <el-descriptions-item label="引体向上">{{ data.pull_up }}</el-descriptions-item>
      <el-descriptions-item label="左眼">{{ data.left_eye }}</el-descriptions-item>
      <el-descriptions-item label="右眼">{{ data.right_eye }}</el-descriptions-item>
      <el-descriptions-item label="BMI分数">{{ data.BMI_sorce }}</el-descriptions-item>
      <el-descriptions-item label="最终分数">{{ data.end_sorce }}</el-descriptions-item>
      <el-descriptions-item label="备注">{{ data.remarks }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import * as measure from '@/api/measure'
export default {
  data() {
    return {
      data: {
        id: 201402120121,
        name: '付竑祥',
        sex: '男',
        nation: '汉族',
        college: '政治与历史学院',
        grade: 2019,
        major: '思想政治教育',
        class: 1,
        idcard: '500236199810255651',
        source: '重庆市奉节县长安土家族乡',
        address: '重庆市奉节县长安土家族乡',
        height: 162,
        weight: 60,
        pulmonary: 3875,
        run50: 6.6,
        jump: 268,
        flexion: 21.3,
        run800: null,
        run1000: "3'43",
        abdominal_curl: -1,
        pull_up: 6,
        left_eye: 4.1,
        right_eye: 4.2,
        BMI_sorce: 100,
        end_sorce: 81.9,
        remarks: ''
      }
    }
  },
  created() {
    if (this.$route.query.row) {
      this.task_id = this.$route.query.row.task_id
      this.id = this.$route.query.row.id
    }
    this.fetchData({ task_id: this.task_id, id: this.id })
  },
  methods: {
    fetchData(value) {
      this.listLoading = true
      measure.detail(value).then(response => {
        this.data = response.data[0]
        this.listLoading = false
      })
    }
  }
}
</script>
<style scoped>
.blank{
  margin: 20px 0 10px 0;
}
</style>
